<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<input type="text" name="" id="texta" value="" />
		<select name="" id="jjcc">
			<option value="a">+</option>
			<option value="b">-</option>
			<option value="c">*</option>
			<option value="d">/</option>
			<option value="e">%</option>
		</select>
		<input type="text" name="" id="textb" value="" />
		结果：<input type="text" name="" id="jieguo" value="" />
		<button id="jisuan" type="submit">计算</button>
	</body>
	<script type="text/javascript">
		document.getElementById("jisuan").onclick=function(){
			var cha=document.getElementById("jjcc").value
			var text_a=parseFloat(document.getElementById("texta").value)
			var text_b=parseFloat(document.getElementById("textb").value)
			if (cha=="a") {
				document.getElementById("jieguo").value= (text_a+text_b).toFixed(4);
			} else if(cha=="b"){
				document.getElementById('jieguo').value=(text_a-text_b).toFixed(4)
			}
			else if(cha=="c"){
				document.getElementById('jieguo').value=(text_a*text_b).toFixed(4)
			}
			else if(cha=="d"){
				document.getElementById('jieguo').value=(text_a/text_b).toFixed(4)
			}else if(cha=="e"){
				document.getElementById('jieguo').value=(text_a%text_b).toFixed(4)
			}
		}
	</script>
</html>
